package filter;
import java.util.List;

import util.*;
public class DownloadFilter implements LinkFilter{

	private List<String> containsList ;
	public DownloadFilter()  {
		try{
		MyXmlUtil xml= new MyXmlUtil("target.xml");
		containsList= xml.getValues("contains");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	@Override
	public boolean accept(String url) {
		boolean result=false;
		try {
			
			
			for(String str:containsList) {
				if(url.contains(str)) {
					result = true;
					break;
				}
			}
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
		
	}
	

}
